import paramiko


class SSHConByPy:
    def __init__(self, hostname, port, name, password):
        # 全部属性
        self.all_message = dict()
        # 获取实例
        self.client = paramiko.SSHClient()
        # 加上这句话不用担心选yes的问题，会自动选上（用ssh连接远程主机时，第一次连接时会提示是否继续进行远程连接，选择yes）
        self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
        # 连接
        self.client.connect(hostname, port, name, password)

    # 关闭连接
    def close_connect(self):
        if self.client is not None:
            self.client.close()

    def get_loadBalance(self):
        pass

    def get_allRAMemory(self):
        pass

    def get_allCPUInformation(self):
        pass

    def get_diskSpace(self):
        pass

